﻿<!--
    © 2012 Alex Kazaev
    FolderDrive project [http://folderdrive.codeplex.com/]
    Licensed under Ms-PL license [http://www.opensource.org/licenses/MS-PL]
    -->
<UserControl x:Class="FolderDrive.Controls.AddMappingControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid Background="Transparent">
        <Border BorderBrush="LightGray" BorderThickness="2" Margin="3" VerticalAlignment="Center" HorizontalAlignment="Center" Background="AliceBlue">
            <StackPanel >
                <TextBlock>Drive Letter:</TextBlock>
                <ComboBox Name="DriveLetter" ItemsSource="{Binding  MappingViewModel.AvailableDriveLetters}" SelectedItem="{Binding MappingViewModel.SelectedDriveLetter}"></ComboBox>
                <TextBlock>Path:</TextBlock>
                <StackPanel Orientation="Horizontal">
                    <TextBox Width="250" HorizontalAlignment="Left" Margin="0 0 6 0" Text="{Binding MappingViewModel.SelectedPath}"></TextBox>
                    <Button Width="50" HorizontalAlignment="Right" Name="SelectFolderButton" Click="OnSelectFolderButtonClick">...</Button>
                </StackPanel>
                <CheckBox IsChecked="{Binding MappingViewModel.IsPermanent}" ToolTip="Creates special mapping in Windows registry. The disk will be available after reboot, FolderDrive execution is not required." Margin="0 5">
                    <Hyperlink>Make Permanent (Administrator)</Hyperlink></CheckBox>
                <StackPanel Orientation="Horizontal" Margin="0 10 0 0" HorizontalAlignment="Right">
                    <TextBlock Foreground="Red" Visibility="{Binding MappingViewModel.ErrorNotificationVisibility}" Margin="0 0 10 0">Check the data!</TextBlock>
                    <Button Width="100" Margin="0 0 10 0" Name="OkButton" Click="OnOkButtonClick">OK</Button>
                    <Button Width="100" Name="CancelButton" Click="OnCancelButtonClick">Cancel</Button>
                </StackPanel>
            </StackPanel>
        </Border>
        <Border BorderBrush="Red" BorderThickness="2" Visibility="{Binding MappingViewModel.ErrorNotificationVisibility}"></Border>
    </Grid>
</UserControl>